function getDeviceId() {
    // TODO: 调试sb
    // return "286370f05269fd31";
    if (!localStorage.getItem('uniqueID')) {
        localStorage.setItem('uniqueID', generateUUID());
    }
    console.log('Unique ID:', localStorage.getItem('uniqueID'));
    return localStorage.getItem('uniqueID')
}

function generateUUID() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

function getUrlParameters() {
    var urlParams = {};
    var match,
        regex = /([^&=]+)=([^&]*)/g;
    var searchString = window.location.search.substring(1);
    while ((match = regex.exec(searchString))) {
        var key = decodeURIComponent(match[1]);
        var value = decodeURIComponent(match[2]);
        urlParams[key] = value;
    }
    return urlParams;
}
